<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
    <div class="table-responsive">
        <table class="table table-bordered">
            <thead>
            <tr>
                <th class="text-center"><div>ID</div></th>
                <th class="text-center" width="15%">对应订单</th>
                <th class="text-center" width="10%">购买商品</th>
                <th class="text-center" width="8%">昵称</th>
                <th class="text-center" width="20%">用户(手机/邮箱/账号)</th>
                <th class="text-center" width="8%">支付时间</th>
                <th class="text-center" width="8%">价格</th>
                <th class="text-center" width="5%">优惠金额</th>
                <th class="text-center" width="5%">支付类型</th>
                <th class="text-center" width="5%">状态</th>
                <th class="text-center" width="5%">操作</th>
            </tr>
            </thead>
        </table>
        <div class="J_V_tabContent table-xScrollWrap">
            <table class="table table-bordered table-hover table-xs-content">
                <tbody>
                <tr class="jqgfirstrow" role="row">
                    <th class="text-center"><div>&nbsp;</div></th>
                    <th class="text-center" width="15%">&nbsp;</th>
                    <th class="text-center" width="12%">&nbsp;</th>
                    <th class="text-center" width="8%">&nbsp;</th>
                    <th class="text-center" width="20%">&nbsp;</th>
                    <th class="text-center" width="8%">&nbsp;</th>
                    <th class="text-center" width="8%">&nbsp;</th>
                    <th class="text-center" width="5%">&nbsp;</th>
                    <th class="text-center" width="5%">&nbsp;</th>
                    <th class="text-center" width="5%">&nbsp;</th>
                    <th class="text-center" width="5%">&nbsp;</th>
                </tr>
                <tr th:if="${#lists.isEmpty(dataMap['list'])}">
                    <td colspan="11" class="text-center">
                        <div class="noDataTipsBox">
                            <p><span class="c-4e fs16">亲，还没有数据~~~</span></p>
                        </div>
                    </td>
                </tr>
                <tr th:if="!${#lists.isEmpty(dataMap['list'])}" th:each="details : ${dataMap['list']}">
                    <td class="text-center">
                        <div class="text-center" th:text="${details['id']}">

                        </div>
                    </td>
                    <td class="text-center" th:text="${details['orderNo']}">
                    </td>
                    <td class="text-center">
                        <span th:if="${details['shopType']}=='COURSE'" th:text="${details['shop']['course']['courseName']}+'[课程]'"></span>
                        <span th:if="${details['shopType']}=='BOOK'" th:text="${details['shop']['book']['bookName']}+'[图书]'"></span>
                        <span th:if="${details['shopType']}=='MEMBER'" th:text="${details['shop']['member']['memberName']}+'[会员]'"></span>
                        <span th:if="${details['shopType']}=='ACCOUNT'">账户充值</span>
                        <span th:if="${details['shopType']}=='QA'" th:text="${#strings.abbreviate(details['shop']['qa']['context'],15)}+'[问答]'"></span>
                        <span th:if="${details['shopType']}=='ATTEND'" th:text="${#strings.abbreviate(details['shop']['qa']['context'],15)}+'[旁听]'"></span>
                        <span th:if="${details['shopType']}=='EXAM'" th:text="${details['shop']}!=null?${details['shop']['exam']['name']}+'[试卷]':''"></span>
                    </td>
                    <td class="text-center">
                        <th:block th:if="!${#maps.isEmpty(details['user'])}">
                            <span th:text="${details['user']['nickname']}">—</span>
                        </th:block>
                        <span th:if="${#maps.isEmpty(details['user'])}">—</span>
                    </td>
                    <td class="text-center">
                        <th:block th:if="!${#maps.isEmpty(details['user'])}">
                            <span th:if="${details['user']['mobile']}==null or ${details['user']['mobile']}==''">—/</span>
                            <span th:if="${details['user']['mobile']}!=null and ${details['user']['mobile']}!=''" th:text="${details['user']['mobile']}+'/'"></span>
                            <span th:if="${details['user']['email']}==null or ${details['user']['email']}==''">—/</span>
                            <span th:if="${details['user']['email']}!=null and ${details['user']['email']}!=''" th:text="${details['user']['email']}+'/'"></span>
                            <span th:if="${details['user']['loginAccount']}==null or ${details['user']['loginAccount']}==''">—</span>
                            <span th:if="${details['user']['loginAccount']}!=null" th:text="${details['user']['loginAccount']}"></span>
                        </th:block>
                        <span th:if="${#maps.isEmpty(details['user'])}">—</span>
                    </td>
                    <td class="text-center" th:text="${!#strings.isEmpty(details['payTime'])?#strings.substring(details['payTime'],0,16):null}">
                    </td>
                    <td class="text-center" th:utext="'原价：'+${details['price']}+'<br/>实价：'+${details['realPrice']}">
                    </td>
                    <td class="text-center" th:utext="'优惠：-'+${details['yhPrice']}+'<br/>活动：-'+${details['activityPrice']}">
                    </td>
                    <td class="text-center">
                        <span th:if="${details['payType']}=='WEIXIN'">微信</span>
                        <span th:if="${details['payType']}=='ALIPAY'">支付宝</span>
                        <span th:if="${details['payType']}=='ACCOUNT'">账户支付</span>
                        <span th:if="${details['payType']}=='IOS'">IOS内购</span>
                        <span th:if="${details['payType']}=='FREE'">免费</span>
                        <span th:if="${details['payType']}=='COURSE_CART'">课程卡</span>
                        <span th:if="${details['payType']}=='GIVING'">赠送</span>
                    </td>
                    <td class="text-center" th:attrappend="id='details-status-box-'+${details['id']}">
                        <span th:if="${details['detailStatus']}=='INIT'" class="label label-danger">未支付</span>
                        <span th:if="${details['detailStatus']}=='SUCCESS'" class="label label-info">已支付</span>
                        <span th:if="${details['detailStatus']}=='REFUND'" class="label label-primary">已退款</span>
                        <span th:if="${details['detailStatus']}=='CANCEL'" class="label label-default">已取消</span>
                        <span th:if="${details['detailStatus']}=='CLOSE'" class="label label-default">已关闭</span>
                    </td>
                    <td class="text-center" data-icon>
                        <a href="javascript:void(0)" class="c-master fs14 details-info-box" th:attrappend="data-id=${details['id']}" data-type="1" data-toggle="tooltip" data-placement="bottom" data-original-title="查看">
                            <i class="fa fa-eye"></i>
                        </a>
                        <a th:if="${details['shopType']}=='COURSE' or ${details['shopType']}=='BOOK' " href="javascript:void(0)" class="c-master fs14 order-status-box" th:attrappend="data-id=${details['id']}" data-status="REFUND" data-toggle="tooltip" data-placement="bottom" data-original-title="退费"><i class="fa fa-sign-out"></i></a>
                        <span th:if="${details['detailStatus']}=='SUCCESS' and (${details['shopType']}=='COURSE' or ${details['shopType']}=='MEMBER')">
                            <a th:if="${details['shopType']}=='COURSE'" href="javascript:void(0)" class="c-master fs14 order-status-box" th:attrappend="data-type=${details['shopType']},data-id=${details['id']}" data-status="CLOSE" data-toggle="tooltip" data-placement="bottom" data-original-title="关闭课程"><i class="fa fa-ban"></i></a>
                            <a th:if="${details['shopType']}=='MEMBER'" href="javascript:void(0)" class="c-master fs14 order-status-box" th:attrappend="data-type=${details['shopType']},data-id=${details['id']}" data-status="CLOSE" data-toggle="tooltip" data-placement="bottom" data-original-title="关闭会员"><i class="fa fa-ban"></i></a>
                            <a th:if="${details['shopType']}=='COURSE'" href="javascript:void(0)" class="c-master fs14 order-status-box" th:attrappend="data-type=${details['shopType']},data-id=${details['id']}" data-status="DELAY" data-toggle="tooltip" data-placement="bottom" data-original-title="延期课程"><i class="fa fa-clock-o"></i></a>
                        </span>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
        <!-- 分页，开始 -->
        <div data-th-replace="layout/adminPage"></div>
        <!-- 分页，结束 -->
    </div>
</html>